
import '../sass/counter.scss';

// import { mapGetters, mapActions } from 'vuex'

export default {
    data() {
        return {
            activeIndex: '1',
            activeIndex2: '1',
            checked: true
        };
    },
    computed: {
        // ...mapGetters([
        //     'evenOrOdd'
        // ]),
        count () {
            return this.$store.state.count
        },
        evenOrOdd () {  //相当于 mapGetters 里的 evenOrOdd
            return this.$store.getters.evenOrOdd
        }
    },
    created:function (){
      console.log('here');
    },
    methods: {
        // ...mapActions([
        //     'incrementAsync'
        // ]),
        increase () {
            this.$store.commit('increase');
        },
        decrease () {
            this.$store.commit('decrease');
        },
        incrementAsync () {  //相当于 mapActions 里的 incrementAsync
            this.$store.dispatch('incrementAsync');
        },
        handleOpen(key, keyPath) {
            console.log(key, keyPath);
        },
        handleClose(key, keyPath) {
            console.log(key, keyPath);
        }
    }
}